package com.heima.kafka.producer;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.stereotype.Service;

@Service
public class KafkaProducer {
    @Autowired
    private KafkaTemplate kafkaTemplate;


    public void producer(){
        for (int i=0; i<10 ;i++ ){
            kafkaTemplate.send("demo01","kfkdemo"+i);
        }

    }
}
